// main.cpp : main
// 2010-03
// http://www.ibm.com/developerworks/cn/linux/l-gperf.html

#include "month.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( int argc, char *argv[] )
{
	for( int i = 1; i < argc; i++ ) {
		const struct month_t *mon = Perfect_Hash::GetMonthByName( argv[i], strlen( argv[i] ) );
		if( NULL == mon ) {
			printf( "!! Bad month name [%s] !!\n", argv[i] );
		}
		else {
			printf( "%s:\n\tName: %s\n\tNumber: %d\n\tDays:%d\n\tLeap Days:%d\n",
					argv[i], mon->name, mon->number, mon->days, mon->leap_days );

		}
	}

	return 0;
}

